<style lang="less">
    @import "loan-taskpool-wait.less";
    @import "../loan-approve-task/style/row-background.less";
</style>
<template>
    <div class="search">
        <Row>
            <Col>
                <Card>
                    <Row class="operation">
                        <Button @click="setHighest('yes')" type="primary">置顶</Button>
                        <Button @click="setHighest('no')" type="primary">取消置顶</Button>
                        <Button @click="setLock('yes')" type="primary" icon="md-lock">锁定</Button>
                        <Button @click="setLock('no')" type="primary" icon="ios-unlock">解锁</Button>
<!--                        <Button @click="setExecuteType" type="primary">手动执行</Button>-->
                        <Button @click="setDealUser" type="primary">指定处理人</Button>
                        <Button @click="addTags" type="primary" icon="md-pricetags">打标签</Button>
                    </Row>
                    <Row>
                        <Form ref="searchForm" :model="searchForm" inline :label-width="100" class="search-form" >
                            <Form-item label="合同号码" prop="applyNo">
                                <Input type="text" v-model="searchForm.contractNo" clearable placeholder="请输入合同号码" style="width: 200px"/>
                            </Form-item>
                            <Form-item label="客户姓名" prop="custName">
                                <Input type="text" v-model="searchForm.custName" clearable placeholder="请输入客户姓名" style="width: 200px"/>
                            </Form-item>
                            <Form-item label="申请编号" prop="applyNo">
                                <Input type="text" v-model="searchForm.applyNo" clearable placeholder="请输入申请编号" style="width: 200px"/>
                            </Form-item>
                            <span v-if="drop">
                                <Form-item label="证件号码" prop="certNo">
                                    <Input type="text" v-model="searchForm.certNo" clearable placeholder="请输入证件号码" style="width: 200px"/>
                                </Form-item>
                                <Form-item label="VIN码" prop="carVin">
                                    <Input type="text" v-model="searchForm.carVin" clearable placeholder="请输入VIN码" style="width: 200px"/>
                                </Form-item>
                                <Form-item label="合作商名称" prop="dealerName">
                                    <Input v-model="searchForm.dealerName" type="text" placeholder="请输入合作商名称" style="width:200px"/>
                                </Form-item>
                                    <!--后台会做处理，直接只显示状态为'放款队列'的数据-->
<!--                                <Form-item label="案件状态" prop="applyStatus">-->
<!--                                    <Select v-model="searchForm.applyStatus" clearable placeholder="请选择案件状态" style="width:200px">-->
<!--                                        <Option v-for="item in dataDic.conApplyStatus" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>-->
<!--                                    </Select>-->
<!--                                </Form-item>-->
                                <Form-item label="渠道类型" prop="channelType">
                                    <Select v-model="searchForm.channelType" clearable placeholder="请选择渠道类型" style="width:200px">
                                        <Option v-for="item in dataDic.channelType" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="业务类型" prop="businessType">
                                    <Select v-model="searchForm.businessType" clearable placeholder="请选择业务类型" style="width:200px">
                                        <Option v-for="item in dataDic.businessType" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="车辆属性" prop="carNature">
                                    <Select v-model="searchForm.carNature" clearable placeholder="请选择车辆属性" style="width:200px">
                                        <Option v-for="item in dataDic.carNature" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="车辆类型" prop="carType">
                                    <Select v-model="searchForm.carType" clearable placeholder="请选择车辆类型" style="width:200px">
                                        <Option v-for="item in dataDic.carType" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="运营方式" prop="operateWay">
                                    <Select v-model="searchForm.operateWay" clearable placeholder="请选择运营方式" style="width:200px">
                                        <Option v-for="item in dataDic.operateWay" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="挂靠方式" prop="affiliatedWay">
                                    <Select v-model="searchForm.affiliatedWay" clearable placeholder="请选择挂靠方式" style="width:200px">
                                        <Option v-for="item in dataDic.affiliatedWay" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="放款模式" prop="lendingMode">
                                    <Select v-model="searchForm.lendingMode" clearable placeholder="请选择放款模式" style="width:200px">
                                        <Option v-for="item in dataDic.lendingMode" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                                <Form-item label="放款申请时间">
                                        <DatePicker v-model="selectDate" type="daterange" format="yyyy-MM-dd" clearable
                                                    @on-change="selectDateRange" placeholder="选择放款申请起止时间"
                                                    style="width: 200px"></DatePicker>
                                </Form-item>
                                <Form-item label="案件标记" prop="caseLabel">
                                    <Select v-model="searchForm.caseLabel" filterable clearable placeholder="请选择案件标记" style="width:200px;">
                                        <Option v-for="item in this.labelList" :label="item.labelName" :value="item.labelId" :key="item.value">{{item.labelName}}</Option>
                                    </Select>                                </Form-item>
                                <Form-item label="优先级" prop="priority">
                                    <Select v-model="searchForm.priority" clearable placeholder="请选择优先级" style="width:200px">
                                        <Option v-for="item in dataDic.priority" :label="item.title" :value="item.value" :key="item.value">{{item.title}}</Option>
                                    </Select>
                                </Form-item>
                            </span>
                            <Form-item style="margin-left: -35px;" v-if="dropDownContent=='展开'">
                                <Button @click="handleSearch" type="primary" icon="ios-search">查询</Button>
                                <Button @click="handleReset" type="primary" icon="ios-trash">重置</Button>
                                <a class="drop-down" @click="dropDown">{{dropDownContent}}
                                    <Icon :type="dropDownIcon"></Icon>
                                </a>
                            </Form-item>
                            <Form-item style="margin-left: -65px;width:100%;text-align: center;" v-if="dropDownContent=='收起'">
                                <Button @click="handleSearch" type="primary" icon="ios-search">查询</Button>
                                <Button @click="handleReset" type="primary" icon="ios-trash">重置</Button>
                                <a class="drop-down" @click="dropDown">{{dropDownContent}}
                                    <Icon :type="dropDownIcon"></Icon>
                                </a>
                            </Form-item>
                        </Form>
                    </Row>
                    <Row>
                        <Table v-bind:loading="loading" border v-bind:columns="columns" v-bind:data="data" sortable="custom"
                               @on-sort-change="changeSort" @on-selection-change="showSelect" :row-class-name="rowClassName" ref="table">
                            <template slot-scope="{row,index}" slot="action">
                                <Button  style="margin-right:5px" type="primary" size="small" @click="showlog(row)">查看日志</Button>
                                <Button  style="margin-right:5px" type="primary" size="small" @click="disable(row)">改派</Button>
                            </template>
                            <template slot-scope="{row , index}" slot="applyStatus">
                                <span>{{setApplyStatusTitle(row.applyStatus)}}</span>
                            </template>
                            <template slot-scope="{row , index}" slot="businessType">
                                <span>{{setBusinessTypeTitle(row.businessType)}}</span>
                            </template>
                            <template slot-scope="{row , index}" slot="lendingMode">
                                <span>{{setLendingModeTitle(row.lendingMode)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="tags">
                                <Tag v-for="item in row.labelList" :color="item.labelColor" >{{item.labelName}}</Tag>
                            </template>
                            <template slot-scope="{ row, index }" slot="topType">
                                <span>{{setIsLockTitle(row.isTop)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="contractNo">
                                <bubble :data="row.remarks" v-if="row.isShowBubble" style="    margin-top: -30px;margin-left: 80px;"></bubble>
                                <label type="primary" size="small">{{row.contractNo+row.tags}}</label>
                            </template>
                        </Table>
                    </Row>
                    <Row type="flex" justify="end" class="page">
                        <Page v-bind:current="searchForm.pageNumber" v-bind:total="total" v-bind:page-size="searchForm.pageSize"
                              @on-change="changePage($event)" @on-page-size-change="changePageSize($event)" v-bind:page-size-opts="[10,20,50]"
                              size="small" show-total show-elevator show-sizer></Page>
                    </Row>
                </Card>
            </Col>
        </Row>
        <Modal v-model="makeLoanLabelVisible" ref="makeLoanlabelOptionModel" :label-width="80" :title="modalTitle" :closable="false" :mask-closable='false' :width="600" :styles="{top: '180px'}">
            <div slot="footer">
                <Button type="text" @click="cancelLabel">取消</Button>
                <Button v-if="lockOptionStatus=='yes'" type="primary" @click="submitLock">提交</Button>
                <Button v-if="lockOptionStatus=='no'" type="primary" @click="setUnLock('no')">提交</Button>
            </div>
            <Row>
                <Form ref="makeLoanLabelOptionForm" :model="makeLoanLabelOptionForm" inline :label-width="80" class="search-form" :rules="formValidate">
                    <Form-item  label="标签名称" prop="labelName">
                        <Input type="textarea" v-model="makeLoanLabelOptionForm.labelName" clearable placeholder="请输入标签" style="width: 450px;height: 50px;" />
                    </Form-item>
                </Form>
            </Row>
        </Modal>
        <modal v-model="lockFormVisible" ref="lockOptionModel" :label-width="80" :title="modalTitle" :closable="false" :mask-closable='false' :width="600" :styles="{top: '180px'}">
            <div slot="footer">
                <Button type="text" @click="cancelLock">取消</Button>
                <Button type="primary" @click="submitLock">提交</Button>
            </div>
            <Row>
                <Form ref="lockOptionForm" :model="lockOptionForm" inline :label-width="80" class="search-form" :rules="formValidate">
                    <Form-item v-if="lockOptionStatus=='yes'" label="锁定原因" prop="processRemark">
                        <Input type="textarea" v-model="lockOptionForm.processRemark" clearable placeholder="请输入锁定原因" style="width: 450px;height: 50px;" />
                    </Form-item>
                    <Form-item v-if="lockOptionStatus=='no'" label="解锁原因" prop="processRemark">
                        <Input type="textarea" v-model="lockOptionForm.processRemark" clearable placeholder="解锁原因" style="width: 450px;height: 50px;" />
                    </Form-item>
                </Form>
            </Row>
        </modal>
        <task-handler :value="appointVisible" @cancel="cancelAppoint"
                      :operation-type="2"
                      :contractNo="appointContractNo"
                      @afterSubmit="afterAppoint"
        />
    </div>
</template>

<script>
    import bubble from "@/projects/afs-core-business/pages/case/approve/loan-approve-task/style/bubble.vue";
    import {
        modifyLock,
        modifyLabel,
        modifyStick,
        getLabelList
    } from '@/projects/afs-core-business/api/afs-case/loan-approve/loanApproveTask'
    import TaskHandler from "./task-handler";
    import {
        getByTypes
    } from "_p/basic/api/admin/datadic";
    import {
        getLoanWaitTaskList
    } from "@/projects/afs-core-business/api/afs-case/taskpool-wait/loan-taskpool-wait";

    export default {
        name: "loan-taskpool-wait",
        components: {
            bubble,
            TaskHandler
        },
        mounted() {
            this.init();
        },
        data(){

            return{
                loading: true,
                operationLoading: false,
                importLoading: false,
                loadingExport: true,
                labelList: [],
                drop: false,
                dropDownContent: "展开",
                dropDownIcon:"ios-arrow-down",
                dicKeys: [
                    'businessType',
                    'conApplyStatus',
                    'carType',
                    'carNature',
                    'operateWay',
                    'affiliatedWay',
                    'lendingMode',
                    'channelType',
                    'priority'
                ],
                businessTypeList: [],
                applyStatusList: [],
                tags:"",
                carType: [],
                carNature: [],
                operateWay: [],
                affiliatedWay: [],
                lendingModeList: [],
                channelType: [],
                interval: null,
                secondsAgo: 0,
                priority:[],
                dataDic: {},
                selectCount: 0,
                selectList: [],
                viewImage: false,
                deptId: [],
                selectDep: [],
                department: [],
                dataDep: [],
                searchKey: "",
                selectDate: null,
                searchForm:{
                    applyNo:"",
                    custName:"",
                    caseLabel:"",
                    dealerName:"",
                    businessStateIn:"",
                    carNature:"",
                    carType:"",
                    operateWay:"",
                    affiliatedWay:"",
                    lendingMode:"",
                    lendingFirstStartDate: "",
                    lendingFirstEndDate: "",
                    pageNumber: 1,
                    pageSize: 10
                },
                submitLoading:false,
                modalTitle: '标签信息',
                lockFormVisible: false,
                lockOptionStatus: '',
                lockOptionForm: {
                    processRemark: ''
                },
                makeLoanLabelVisible: false,
                makeLoanLabelOptionForm: {
                    labelName: ''
                },
                topOptionStatus: '',
                appointVisible:false,
                appointContractNo:"",
                formValidate: {
                    processRemark: [
                        { required: true, message: '备注不能为空', trigger: 'blur' }
                    ],
                    labelName: [
                        { required: true, message: '备注不能为空', trigger: 'blur' }
                    ]
                },
                columns:[
                    {
                        type:"selection",
                        minWidth:60,
                        maxWidth:60,
                        align:"center",
                        fixed:"left"
                    },
                    {
                        title:"合同号码",
                        key:"contractNo",
                        minWidth:170,
                        fixed: "left",
                        tooltip: true,//显示提示
                        slot: 'contractNo'

                    },
                    {
                        title:"客户姓名",
                        key:"custName",
                        minWidth:165,
                        fixed: "left",
                        tooltip: true//显示提示
                    },
                    {
                        title:"案件状态",
                        key:"applyStatus",
                        slot:"applyStatus",
                        minWidth:120,
                    },
                    {
                        title:"合作商名称",
                        key:"dealerName",
                        minWidth:165,
                    },
                    {
                        title: '案件标记',
                        key: 'tags',
                        minWidth: 280,
                        slot: "tags"
                    },
                    {
                        title:"申请编号",
                        key:"applyNo",
                        minWidth:165,
                        tooltip: true,//显示提示
                    },
                    {
                        title:"业务类型",
                        key:"businessType",
                        slot:"businessType",
                        minWidth:100,
                    },
                    {
                        title:"放款模式",
                        key:"lendingMode",
                        slot:"lendingMode",
                        minWidth:130,
                    },
                    {
                        title:"优先级",
                        key:"priority",
                        minWidth:90,
                    },
                    {
                        title:"放款申请时间",
                        key:"lendingFirstDate",
                        minWidth:160,
                    },
                    {
                        title:"欺诈风险",
                        key:"fraudInfo",
                        minWidth:100,
                    },
                    {
                        title: "是否置顶",
                        key: "isTop",
                        minWidth: 110,
                        slot:"topType",
                        sortable: true,
                    },
                ],
                data:[],
                total:0
            };
        },

        methods: {
            init() {
                this.searchForm.pageNumber = 1;
                this.searchForm.pageSize = 10;
                this.getTaskList();
                this.initDataDic();
                this.getLabelList()
            },
            initDataDic(){
                let self = this;
                getByTypes(this.dicKeys).then(res => {
                    if (res.code === '0000' && res.data) {
                        self.dataDic = res.data
                        this.businessTypeList.push(...res.data.businessType)
                        this.applyStatusList.push(...res.data.conApplyStatus)
                        this.carType.push(...res.data.carType)
                        this.carNature.push(...res.data.carNature)
                        this.operateWay.push(...res.data.operateWay)
                        this.affiliatedWay.push(...res.data.affiliatedWay)
                        this.lendingModeList.push(...res.data.lendingMode)
                        this.priority.push(...res.data.priority);
                        this.channelType.push(...res.data.channelType)
                    }
                })
                console.log(this.dataDic)
            },
            getLabelList(){
                getLabelList().then(res=>{
                    this.labelList = res.data;
                    console.log(res.data)
                })
            },
            rowClassName (row, index) {
                if (row.isLock =="yes") {
                    return 'demo-table-lock-row';
                }
                if(row.isOverdue=="yes"){
                    return 'demo-table-overdue-row';
                }
                if(row.needReview=="yes"){
                    return 'demo-table-retrial-row';
                }

                return '';
            },
            setApplyStatusTitle(val) {
                let dic = {}
                this.applyStatusList.forEach(colunm => {
                    if (colunm.value === val) {
                        dic = colunm
                    }
                })
                return dic.title
            },
            setBusinessTypeTitle(val) {
                let dic = {}
                this.businessTypeList.forEach(colunm => {
                    if (colunm.value === val) {
                        dic = colunm
                    }
                })
                return dic.title
            },
            setLendingModeTitle(val){
                let dic = {}
                this.lendingModeList.forEach(colunm => {
                        if (colunm.value === val){
                            dic=colunm;
                        }
                    }
                );
                return dic.title;
            },
            selectDateRange(v) {
                if (v) {
                    this.searchForm.startDate = v[0];
                    this.searchForm.endDate = v[1];
                }
            },
            setIsLockTitle(val){
                if(val =='yes'){
                    return '是'
                }else{
                    return '否'
                }
            },
            handleSearch() {
                this.searchForm.pageNumber = 1;
                this.searchForm.pageSize = 10;
                this.getTaskList();
            },
            dropDown() {
                if (this.drop) {
                    this.dropDownContent = "展开";
                    this.dropDownIcon = "ios-arrow-down";
                } else {
                    this.dropDownContent = "收起";
                    this.dropDownIcon = "ios-arrow-up";
                }
                this.drop = !this.drop;
            },
            handleReset() {
                this.$refs.searchForm.resetFields();
                this.searchForm.pageNumber = 1
                this.searchForm.pageSize = 10
                this.selectDate = null
                this.searchForm.startDate = null
                this.searchForm.endDate = null
                // 重新加载数据
                this.getTaskList();
            },
            hasSelectedLabel() {
                if (this.selectCount == 0) {
                    this.$Message.warning('需先勾选数据行!')
                    return false
                } else if(this.selectCount != 1) {
                    this.$Message.warning('打标签只能勾选一行数据行!')
                    return false
                } else {
                    return true
                }
            },
            seizeTask() {
                this.$refs.searchForm.resetFields();
                this.searchForm.pageNumber = 1;
                this.searchForm.pageSize = 10;
                this.selectDate = null;
                this.searchForm.lendingFirstStartDate = "";
                this.searchForm.lendingFirstEndDate = "";
            },
            getTaskList(){
                this.loading = true;
                getLoanWaitTaskList(this.searchForm).then(res =>{
                    this.loading=false;
                    if(res.code === "0000"){
                        this.data = res.data.records;
                        this.total = res.data.total;
                        this.data.forEach(i=>{
                            if(i.lendingMode=='03'){
                                i.tags="(签约后放款)";
                            }else{
                                i.tags="";
                            }
                            if(i.remarks!=undefined&&i.remarks.length>0){
                                i.isShowBubble=true
                            }else{
                                i.isShowBubble=false
                            }
                        })
                    }
                    if(this.total > 0) {
                        this.startAddSeconds();
                    }
                });
                this.selectCount=0;
            },
            startAddSeconds() {
                if (this.interval) {
                    clearInterval(this.interval);
                }
                this.secondsAgo = 0;
                let _this = this;
                this.interval = setInterval(() => {
                    _this.secondsAgo++;
                }, 1000);
            },
            clearSelectAll() {
                this.$refs.table.selectAll(false);
            },
            changeSort(e) {
                this.searchForm.sort = e.key;
                this.searchForm.order = e.order;
                if (e.order === "normal") {
                    this.searchForm.order = "";
                }
                this.getTaskList();
            },
            showSelect(e) {
                this.selectList = e;
                this.selectCount = e.length;
            },
            changePage(v) {
                this.searchForm.pageNumber = v;
                this.getTaskList();
                this.clearSelectAll();
            },
            changePageSize(v) {
                this.searchForm.pageSize = v;
                this.getTaskList();
            },
            hasSelected() {
                if (this.selectCount == 0) {
                    this.$Message.warning('需先勾选数据行!')
                    return false
                } else {
                    return true
                }
            },
            setDealUser() {
                if(this.hasSelected()) {
                    if (this.selectCount == 1) {
                        this.appointVisible = true;
                        console.log(this.selectList)
                        this.appointContractNo = this.selectList[0].contractNo;
                    } else {
                        this.$Message.warning("不可对多个案件同时发起指定处理人流程");
                    }
                }
            },
            //锁定、解锁
            setLock(status) {
                if (this.hasSelected()) {
                    if (this.existsCurrentStatus('1', status)) {
                        this.$Message.warning(
                            '已选择数据存在' +
                            (status == 'yes' ? '已锁定' : '非锁定') +
                            '数据，请去除勾选后再操作'
                        )
                    } else {
                        if (status == 'yes') {
                            this.modalTitle = '锁定操作备注'
                        } else {
                            this.modalTitle = '解锁操作备注'
                        }
                        this.lockOptionStatus = status
                        this.lockFormVisible = true
                    }
                }
            },
            //锁定原因备注提交
            submitLock() {
                let validResult = true
                this.$refs.lockOptionForm.validate(valid => {
                    if (!valid) {
                        this.$Message.error('数据不合规，请检查数据项')
                        validResult = false
                    }
                })
                if (validResult) {
                    this.operationLoading = true
                    this.loading = true
                    let data = []
                    this.selectList.forEach(function(e) {
                        data += e.contractNo + ','
                    })
                    modifyLock(
                        data,
                        this.lockOptionForm.processRemark,
                        this.lockOptionStatus
                    ).then(res => {
                        if (res.code == '0000') {
                            this.$Message.success('操作成功')
                            this.getTaskList()
                        }
                    })
                    this.loading = false
                    this.cancelLock()
                    this.operationLoading = false
                }
            },
            existsCurrentStatus(type, status) {
                let currentStatusNum = 0
                this.selectList.forEach(record => {
                    if (type == '1') {
                        if (record.isLock == status) {
                            currentStatusNum++
                        }
                    } else if (type == "2") {
                        if (record.isTop == status) {
                            currentStatusNum++
                        }
                    }
                })
                return currentStatusNum > 0
            },
            //标签提交
            submitLabel() {
                let validResult = true
                this.$refs.makeLoanLabelOptionForm.validate(valid => {
                    if (!valid) {
                        this.$Message.error('数据不合规，请检查数据项')
                        validResult = false
                    }
                })
                if (validResult) {
                    this.operationLoading = true
                    this.loading = true
                    let data = []
                    this.selectList.forEach(function(e) {
                        data += e.contractNo + ','
                    })
                    modifyLabel(
                        data,
                        this.makeLoanLabelOptionForm.labelName,
                    ).then(res => {
                        if (res.code == '0000') {
                            this.$Message.success('操作成功')
                            this.getTaskList()
                        }
                    })
                    this.loading = false
                    this.cancelLabel()
                    this.operationLoading = false
                }
            },
            cancelLabel() {
                this.makeLoanLabelVisible = false
                this.makeLoanLabelOptionForm.labelName = ''
            },
            cancelLock() {
                this.lockFormVisible = false
                this.lockOptionForm.processRemark = ''
            },
            //解锁
            setUnLock(status) {
                if (this.hasSelected()) {
                    if (this.existsCurrentStatus('1', status)) {
                        this.$Message.warning(
                            '已选择数据存在' +
                            (status == 'yes' ? '已锁定' : '非锁定') +
                            '数据，请去除勾选后再操作'
                        )
                    }else{
                        this.lockOptionStatus=status
                        let validResult = true
                        this.$refs.lockOptionForm.validate(valid => {
                            if (!valid) {
                                this.$Message.error('数据不合规，请检查数据项')
                                validResult = false
                            }
                        })
                        if (validResult) {
                            this.operationLoading = true
                            this.loading = true
                            let data = []
                            this.selectList.forEach(function(e) {
                                data += e.contractNo + ','
                            })
                            modifyLock(
                                data,
                                this.lockOptionForm.processRemark,
                                this.lockOptionStatus
                            ).then(res => {
                                if (res.code == '0000') {
                                    this.$Message.success('操作成功')
                                    this.getTaskList()
                                }
                            })
                            this.loading = false
                            this.cancelLock()
                            this.operationLoading = false
                        }
                    }
                }
            },
            unlockTask(){

            },
            addTags() {
                if (this.hasSelectedLabel()) {
                    this.modalTitle = '案件打标签'
                    this.makeLoanLabelVisible = true
                }
            },
            //置顶
            setHighest(status) {
                if (this.hasSelected()) {
                    if(this.existsCurrentStatus("2",status)){
                        this.$Message.warning("已选择数据存在" +
                            (status == "yes" ? "已置顶" : "非置顶") +
                            "数据，请去除勾选后再操作");
                    } else {
                        this.topOptionStatus=status
                        this.operationLoading = true
                        this.loading = true
                        let data = []
                        this.selectList.forEach(function(e) {
                            data += e.contractNo + ','
                        })
                        modifyStick(
                            data,
                            this.topOptionStatus
                        ).then(res => {
                            if (res.code == '0000') {
                                this.$Message.success('操作成功')
                                this.getTaskList()
                            }
                        })
                        this.loading = false
                        this.operationLoading = false
                    }
                }
            },
            cancelAppoint(){
                this.appointVisible = false
            },
            afterAppoint(){
                this.getTaskList();
                this.appointVisible = false
            },
            setExecuteType(){

            }
        }
    };
</script>

<style scoped>

</style>
